/**
 * 组织架构相关的接口
 */
import request from '@/utils/request'

// TAG获取组织架构数据
export function getDepartments () {
  return request({
    method: 'GET',
    url: '/company/department'
  })
}

// TAG 根据ID删除部门
export const delDepartments = id => {
  return request({
    method: 'DELETE',
    url: `/company/department/${id}`
  })
}

// TAG 新增部门接口
export const addDepartments = data => {
  return request({
    method: 'POST',
    url: '/company/department',
    data
  })
}

// TAG 获取员工的简单列表
export const getEmployeeSimple = () => {
  return request({
    method: 'GET',
    url: '/sys/user/simple'
  })
}

// TAG 根据ID查询部门详情
export const getDepartDetail = id => {
  return request({
    method: 'GET',
    url: `/company/department/${id}`
  })
}

// TAG 编辑部门
export const updateDepartments = data => {
  return request({
    method: 'put',
    url: `/company/department/${data.id}`,
    data
  })
}
